#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>


using namespace std;

typedef long long LL;

bool is_valid(int b)
{
    LL dt = 1 + 8ll * b;
    LL r = sqrt(dt);
    if(r*r != dt) return false;
    if((r-1) % 2) return false;
    return true;
}

bool check(int n)
{
    for (int i = 1; i*(i+1)/2 < n; i ++ )
        if(is_valid(n-i*(i+1)/2))
            return true;
    return false;
}

int main()
{
    int n;
    cin >> n;
    
    if(check(n)) puts("YES");
    else puts("NO");
    
    return 0;
}